<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
Set Variables
</TITLE>
</HEAD>
<BODY >
<A HREF="tutorial072.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial070.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial074.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc144">10.3</A>&nbsp;&nbsp;Set Variables</H2>
<A NAME="@default254"></A>

Set variables are variables which can eventually take a ground integer
set as their value. They are characterized by a lower bound (the set
of elements that are definitely in the set) and an upper bound (the
set of elements that may be in the set). A set variable can be
declared as follows: 
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
SetVar :: []..[1,2,3,4,5,6,7]
</PRE></BLOCKQUOTE>
If the lower bound is the empty set and the upper bound is a set of
consecutive integers, one can also declare it like
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
intset(SetVar, 1, 7)
</PRE></BLOCKQUOTE>
which is equivalent to the above. 

	<BLOCKQUOTE CLASS="figure"><DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV>
	<DIV CLASS="center">
	<TABLE CELLPADDING=10>
<TR><TD BGCOLOR="#DB9370">
	
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<A HREF="../bips/lib/ic_sets/NN-2.html"><B>?Set :: ++Lwb..++Upb</B></A><A NAME="@default255"></A><DD CLASS="dd-description">
 Set is an integer set within the given bounds 
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_sets/intset-3.html"><B>intset(?Set, +Min, +Max)</B></A><A NAME="@default256"></A><DD CLASS="dd-description">
 Set is a set containing numbers between Min and Max 
<DT CLASS="dt-description"><A HREF="../bips/lib/ic_sets/intsets-4.html"><B>intsets(?Sets, ?N, +Min, +Max)</B></A><A NAME="@default257"></A><DD CLASS="dd-description">
 Sets is a list of N sets containing numbers between Min and Max 
</DL>

	</TD>
</TR></TABLE>
	</DIV>
	<BR>
<BR>
<DIV CLASS="center">Figure 10.1: Declaring Set Variables</DIV><BR>
<BR>

	<DIV CLASS="center"><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
The system prints set variables in a particular way, for instance:
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
?- lib(ic_sets).
?- X :: [2,3]..[1,2,3,4].
X = X{[2, 3] \/ ([] .. [1, 4]) : _308{[2 .. 4]}}
</PRE></BLOCKQUOTE>
The curly brackets contain the description of the current domain
of the set variable in the form of
<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
the lower bound of the set (values which definitely are in the set)
<LI CLASS="li-enumerate">the union symbol <CODE>\/</CODE>
<LI CLASS="li-enumerate">the set of optional values (which may or may not be in the set)
<LI CLASS="li-enumerate">a colon
<LI CLASS="li-enumerate">a finite domain variable indicating the admissible cardinality for the set
</OL>
<HR>
<A HREF="tutorial072.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial070.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="tutorial074.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
